import request from '@/utils/request'

export const getCollectReport = (start, end) => {
  return request.get(`/api/task-service/task/taskReportInfo/${start}/${end}`)
}

export const getTaskStatus = () => {
  return request.get('/api/task-service/task/allTaskStatus')
}

export const taskSearch = (params) => {
  return request.get('/api/task-service/task/search', {
    params
  })
}

export const getTaskTypeList = (alertValue) => {
  return request.get('/api/task-service/taskType/list')
}

export const createTask = (data) => {
  return request.post('/api/task-service/task/create', data)
}

export const getAlertValue = () => {
  return request.get('/api/task-service/task/supplyAlertValue')
}

export const setAlertValue = (data) => {
  return request.post('/api/task-service/task/autoSupplyConfig', data)
}

export const getTaskDetails = (taskId) => {
  return request.get(`/api/task-service/taskDetails/${taskId}`)
}

export const getTaskInfo = (taskId) => {
  return request.get(`/api/task-service/task/taskInfo/${taskId}`)
}

export const cancelTask = (data) => {
  return request.post(`/api/task-service/task/cancel/${data.taskId}`, data)
}
